package com.doctor.controller.front;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.doctor.common.Constat;
import com.doctor.entity.Case;
import com.doctor.entity.Department;
import com.doctor.service.CaseService;
import com.doctor.service.DeparmentService;

@Controller
public class IndexController {

	@Resource
	private DeparmentService deparmentService;
	
	@Resource CaseService caseService;
	
	//首页
	@RequestMapping("/")
	public String index() {
		return "front/index";
	}

	//视频专家
	@RequestMapping("/videoExpert.html")
	public String videoExpert(ModelMap map) {
		return "front/videoExpert";
	}
	
	//上海就医代办
	@RequestMapping("/shanghaiMedical.html")
	public String shanghaiMedical(ModelMap map) {
		List<Case> list = caseService.findByTypeIdOrderByCreateTimeDesc(Constat.LAIHUJIUYI);
		map.put("list", list);
		return "front/shanghaiMedical";
	}
	
	//专家外派
	@RequestMapping("/expertAssignment.html")
	public String expertAssignment(ModelMap map) {
		List<Case> list = caseService.findByTypeIdOrderByCreateTimeDesc(Constat.WAIPAISHOUSHU);
		map.put("list", list);
		return "front/expertAssignment";
	}
	
	//居家健康监护
	@RequestMapping("/homeHealth.html")
	public String homeHealth(ModelMap map) {
		return "front/homeHealth";
	}
	
	//高级医师
	@RequestMapping("/seniorDoctor.html")
	public String seniorDoctor(ModelMap map) {
		List<Department> list = deparmentService.findAll();
		map.put("list", list);
		return "front/seniorDoctor";
	}
	
	//注册登记
	@RequestMapping("/register.html")
	public String register(ModelMap map, String profession) {
		map.put("profession", profession);
		return "front/register";
	}
	
}
